package com.isoftstone.util;

public enum ErrorCode {
    // 学生相关错误
    STUDENT_NOT_FOUND(1001, "不存在该学生"),
    STUDENT_ALREADY_ACTIVATED(1002, "此账号已注册"),
    PHONE_FORMAT_ERROR(1003, "手机号格式不正确"),
    PASSWORD_TOO_SHORT(1004, "密码长度不能少于6位"),
    PARAM_ERROR(400, "参数错误");

    private final int code;
    private final String msg;

    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    // 必须提供getter方法，否则BusinessException无法访问
    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}